import java.io.FileNotFoundException;
import java.io.FileReader;
import java.io.FileWriter;
import java.io.IOException;

public class Test3 {
    public static void main(String[] args) throws IOException {

        //第三题
        FileReader fr = new FileReader("D:/ceishi/aca.txt");
        //第四题
        FileWriter fw = new FileWriter("D:/ceishi/aca.txt");


        fw.write("登鹳雀楼");
        fw.write("\r\n");
        fw.write("王之涣");
        fw.write("\r\n");
        fw.write("白日依山尽，");
        fw.write("\r\n");
        fw.write("黄河入海流。");
        fw.write("\r\n");
        fw.write("欲穷千里目，");
        fw.write("\r\n");
        fw.write("更上一层楼。");

        int a ;
        while ((a=fr.read())!=-1){
            fr.read();
        }
        fw.close();
        fr.close();
    }
}
